//
//  imageviewAndLabel.m
//  敢唆嘛!
//
//  Created by lanou on 15/11/23.
//  Copyright © 2015年 zms. All rights reserved.
//

#import "imageviewAndLabel.h"

@implementation imageviewAndLabel


-(id)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        //创建图片位置 是宽的的三分之一
        self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, frame.size.width/10, frame.size.height/2)];
        
        //图片在自己的中间位置
        self.imageView.center = CGPointMake(frame.size.width/7, frame.size.height/2);
        
        [self addSubview:_imageView];
        
        //创建文字位置 是正宽的三分之二 靠近左侧
        self.label = [[UILabel alloc]initWithFrame:CGRectMake(_imageView.frame.size.width+frame.size.width/5, 0, frame.size.width - _imageView.frame.size.width, frame.size.height)];
        
        self.label.textAlignment = NSTextAlignmentLeft;
        
        //字体的颜色是白色
        self.label.textColor = [UIColor whiteColor];
        
        //添加
        [self addSubview:_label];
        
        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
